package com.voodoo.lib_databases.table;

import com.voodoo.lib_databases.utils.FieldUtils;

/**
 * Author: voodoo
 * CreateDate: 2021/05/22
 * Description:
 */
public class KeyValue {

    private String key;
    private Object value;

    public KeyValue(String key, Object value) {
        this.key = key;
        this.value = value;
    }

    public KeyValue() {
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Object getValue() {
        if (value instanceof java.util.Date || value instanceof java.sql.Date) {
            return FieldUtils.SDF.format(value);
        }
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }

}
